import {createWebHistory,createRouter} from "vue-router";

import index from '../view/index.vue'
import user from '../view/user.vue'
import book from '../view/book.vue'
import category from '../view/category.vue'
import login from '../view/Login.vue'
import bookshelf from '../view/bookshelf.vue'
import user_book from '../view/user_book.vue'
import notion from '../view/notion.vue'
import user_notion from '../view/user_notion.vue'
import editPassword from '../view/editpassword.vue'
import borrow_records from '../view/borrow_records.vue'
import borrow from '../view/borrow.vue'

const routes = [
    {
        path: '/login',
        name: 'login',
        component: login
    },
    {path: '/editpassword', component: editPassword},
    {
        path: '/',
        name: 'index',
        component: index,
        children: [
            {path: '/user',component: user}
            ,{path: '/book',component: book}
            ,{path: '/category',component: category}
            ,{path: '/bookshelf',component: bookshelf}
            ,{path: '/user_book',component: user_book}
            ,{path: '/notion',component: notion}
            ,{path: '/user_notion',component: user_notion}
            ,{ path: '/borrow_records', component: borrow_records }
            ,{ path: '/borrow', component: borrow }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})
export default router;